package com.ruoyi.project.system.information.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.information.mapper.CustomerInformationMapper;
import com.ruoyi.project.system.information.domain.CustomerInformation;
import com.ruoyi.project.system.information.service.ICustomerInformationService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 微信订单Service业务层处理
 * 
 * @author xc
 * @date 2020-02-29
 */
@Service
public class CustomerInformationServiceImpl implements ICustomerInformationService 
{
    @Autowired
    private CustomerInformationMapper customerInformationMapper;

    /**
     * 查询微信订单
     * 
     * @param id 微信订单ID
     * @return 微信订单
     */
    @Override
    public CustomerInformation selectCustomerInformationById(Integer id)
    {
        return customerInformationMapper.selectCustomerInformationById(id);
    }

    /**
     * 查询微信订单列表
     * 
     * @param customerInformation 微信订单
     * @return 微信订单
     */
    @Override
    public List<CustomerInformation> selectCustomerInformationList(CustomerInformation customerInformation)
    {
        customerInformation.setDel(0);
        return customerInformationMapper.selectCustomerInformationList(customerInformation);
    }

    /**
     * 新增微信订单
     * 
     * @param customerInformation 微信订单
     * @return 结果
     */
    @Override
    public int insertCustomerInformation(CustomerInformation customerInformation)
    {
        customerInformation.setCreateTime(DateUtils.getNowDate());
        return customerInformationMapper.insertCustomerInformation(customerInformation);
    }

    /**
     * 修改微信订单
     * 
     * @param customerInformation 微信订单
     * @return 结果
     */
    @Override
    public int updateCustomerInformation(CustomerInformation customerInformation)
    {
        customerInformation.setUpdateTime(DateUtils.getNowDate());
        return customerInformationMapper.updateCustomerInformation(customerInformation);
    }

    /**
     * 删除微信订单对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteCustomerInformationByIds(String ids)
    {
        return customerInformationMapper.deleteCustomerInformationByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除微信订单信息
     * 
     * @param id 微信订单ID
     * @return 结果
     */
    @Override
    public int deleteCustomerInformationById(Integer id)
    {
        return customerInformationMapper.deleteCustomerInformationById(id);
    }
}
